package educrypt.gui.components;

import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Window;
import java.awt.event.ActionListener;

import educrypt.gui.view.AnalysisDetailView;
import educrypt.gui.view.AnalysisResultView;
import educrypt.i18n.Messages;

class AnalysisDetailDialog extends EducryptDialog implements AnalysisDetailView {

	private static final long serialVersionUID = -2437361402153518594L;

	private AnalysisResultPanel analysisResultPanel;

	public AnalysisDetailDialog(Window owner) {
		super(owner);
		setTitle(Messages.getString("guiAnalysisResults"));

		analysisResultPanel = new AnalysisResultPanel();

		Dimension size = new Dimension(analysisResultPanel.getSize().width,
				analysisResultPanel.getSize().height + 50);
		this.setSize(size);
		this.setPreferredSize(this.getSize());
		getContentPane().setLayout(new FlowLayout());
		getContentPane().add(analysisResultPanel);
	}

	@Override
	public AnalysisResultView getAnalysisResultPanel() {
		return analysisResultPanel;
	}

	@Override
	public void addListener(ActionListener ctr) {
		analysisResultPanel.addListener(ctr);
	}
}
